/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.Severity;

/**
 *
 * @author HuyNVK
 */
@Stateless
public class SeverityFacade extends AbstractFacade<Severity> implements SeverityFacadeRemote {
    @PersistenceContext(unitName = "ejb-servPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public SeverityFacade() {
        super(Severity.class);
    }

    @Override
    public Severity merge(Severity severity) {
        return em.merge(severity);
    }

    @Override
    public void deleteByID(String id) {
        Severity severity = find(id);
        severity = em.merge(severity);
        em.remove(severity);
    }

    @Override
    public void insert(Severity severity) {
        em.persist(severity);
    }
    
}
